<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background-color: pink;
    }
  </style>
  <script src="jquery.min.js"></script>
  <script>
    $(function () {
      $(document).on("click", function () {
        console.log("点击document")
      })
      $("div").on("click", function (e) {
        console.log("点击div")

        e.stopPropagation() // 阻止事件冒泡
        // e.preventDefault() // 阻止默认行为
      })
    })
  </script>
</head>

<body>
  <div></div>
</body>

</html>